Skip to content

feat: improve connect screen with interactive setup wizard#16

Open
liuxiaopai-ai wants to merge 1 commit intoibelick:mainfrom
liuxiaopai-ai:feat/improve-connect-screen
Open

feat: improve connect screen with interactive setup wizard#16
liuxiaopai-ai wants to merge 1 commit intoibelick:mainfrom
liuxiaopai-ai:feat/improve-connect-screen

Conversation

@liuxiaopai-ai
Copy link

Summary

Closes #6

The current connect screen only shows static instructions telling users to manually create .env.local files and restart the dev server. This is confusing — users don't understand what values to use or that they need to restart.

Changes

New: Interactive connection form

  • Clean form with fields for Gateway URL (default: ws://127.0.0.1:18789), Token (recommended), and Password (fallback)
  • "Test Connection" button that validates credentials server-side before the user saves anything
  • Clear success/error states with actionable feedback
  • Auto-generated copy-paste .env.local snippet pre-filled with the user's values
  • Explicit restart instructions shown after successful test

New: /api/connect-test endpoint

  • POST endpoint that accepts { url, token, password } and tests the gateway connection with those credentials
  • Uses a new gatewayConnectTest() helper in gateway.ts — same WebSocket handshake logic but with caller-provided credentials instead of env vars

Improved: Manual setup as collapsible

  • Existing manual .env.local instructions moved into a collapsible "Manual setup instructions" section for advanced users
  • "Where to find these values" reference card kept at the bottom

Design decisions

  • No server architecture changes — the form tests credentials then guides users to save .env.local and restart. Clean and simple.
  • Uses existing UI components (Button, Collapsible, CodeBlock) and Tailwind patterns
  • Uses @hugeicons/react icons consistent with the rest of the app
  • Minimal footprint: 3 files changed, ~350 lines added

Closes ibelick#6

- Add interactive connection form with fields for Gateway URL, Token, and Password
- Add 'Test Connection' button that validates credentials server-side before saving
- Show clear success/error states with actionable feedback
- Auto-generate a copy-paste .env.local snippet pre-filled with user's values
- Move existing manual setup instructions into a collapsible section
- Add /api/connect-test POST endpoint for testing arbitrary gateway credentials
- Add gatewayConnectTest() helper in gateway.ts for dynamic credential testing
@liuxiaopai-ai liuxiaopai-ai force-pushed the feat/improve-connect-screen branch from 50870c3 to 6d8caa5 Compare February 9, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve WebClaw Welcome/Connect Screen

1 participant